/*******************************************************************************
* 
* ResourceManager takes responsibility to read and write all the resources
* 
* 
******************************************************************************/
#pragma once
#include "noria.h"
#include "json/json.h"

namespace noria{ namespace io
{

    class ResourceManager
    {
    public:
        ResourceManager(pointer hMod);
        ~ResourceManager(void);

        // ------------------------------------------------------------------------------------
        // get the specific resource as binary
        // ------------------------------------------------------------------------------------
        binary_sp get(const string& category, const string& name) const;

        // ------------------------------------------------------------------------------------
        // internal used for package all the resources into a single file
        // ------------------------------------------------------------------------------------
        void package(const wstring& source, const wstring& dest) const;

    private:
        void init(pointer pMod);

    private:
        unique_ptr<Json::Value> m_meta;
        binary_sp m_data;
    };

}}